﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gds.Model.ConfigModel.GasMeter
{
    public class AlarmSearchModel : INotifyPropertyChanged
    {
        private int _recordIndex;
        private string _areaName;
        private string _gasmeterId;
        private string _gasTestType;
        private string _gasRange;
        private string _gasUnit;
        private string _alarmlimit;
        private string _alarmlow;
        private string _alarmhigh;
        private string _gasStatu;
        private string _keepingTime;
        private DateTime _startTime = DateTime.Now;
        private DateTime _endTime = DateTime.Now;
        private string _gasValue;
        private string _childAreaName;
        private string _settingLocation;

        public string StartTimeShow
        {
            get
            {
                return StartTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
        }
        public string EndTimeShow
        {
            get
            {
                if (EndTime.Year == 1 && EndTime.Month == 1 && EndTime.Day == 1)
                {
                    return "告警尚未结束";
                }
                else
                {
                    return EndTime.ToString("yyyy-MM-dd HH:mm:ss");
                }

            }
        }
        public int RecordIndex
        {
            get { return _recordIndex; }
            set
            {
                _recordIndex = value;
                OnPropertyChange("RecordIndex");
            }
        }
        public string AreaName
        {
            get { return _areaName; }
            set
            {
                _areaName = value;
                OnPropertyChange("AreaName");
            }
        }
        public string GasmeterId
        {
            get { return _gasmeterId; }
            set
            {
                _gasmeterId = value;
                OnPropertyChange("GasmeterId");
            }
        }
        public string GasTestType
        {
            get { return _gasTestType; }
            set
            {
                _gasTestType = value;
                OnPropertyChange("GasTestType");
            }
        }
        public string GasRange
        {
            get { return _gasRange; }
            set
            {
                _gasRange = value;
                OnPropertyChange("GasRange");
            }
        }
        public string GasUnit
        {
            get { return _gasUnit; }
            set
            {
                _gasUnit = value;
                OnPropertyChange("GasUnit");
            }
        }
        public string Alarmlimit
        {
            get { return _alarmlimit; }
            set
            {
                _alarmlimit = value;
                OnPropertyChange("Alarmlimit");
            }
        }
        public string Alarmlow
        {
            get { return _alarmlow; }
            set
            {
                _alarmlow = value;
                OnPropertyChange("Alarmlow");
            }
        }
        public string Alarmhigh
        {
            get { return _alarmhigh; }
            set
            {
                _alarmhigh = value;
                OnPropertyChange("Alarmhigh");
            }
        }
        public string GasStatu
        {
            get
            {
                return _gasStatu;

            }
            set
            {
                _gasStatu = value;
                OnPropertyChange("GasStatu");
            }
        }
        public string KeepingTime
        {
            get
            {
                //if (EndTime.Year == 1 && EndTime.Month == 1 && EndTime.Day == 1)
                //{
                //    return "";
                //}
                //else
                {
                    return _keepingTime;
                }
            }
            set
            {
                _keepingTime = value;
                OnPropertyChange("KeepingTime");
            }
        }
        public DateTime StartTime
        {
            get { return _startTime; }
            set
            {
                _startTime = value;
                OnPropertyChange("StartTime");
            }
        }
        public DateTime EndTime
        {
            get { return _endTime; }
            set
            {
                _endTime = value;
                OnPropertyChange("EndTime");
            }
        }
        public string GasValue
        {
            get { return _gasValue; }
            set
            {
                _gasValue = value;
                OnPropertyChange("GasValue");
            }
        }
        /// <summary>
        /// 子分区名
        /// </summary>
        public string ChildAreaName
        {
            get { return _childAreaName; }
            set
            {
                _childAreaName = value;
                OnPropertyChange("ChildAreaName");
            }
        }
        /// <summary>
        /// 安装位置
        /// </summary>
        public string SettingLocation
        {
            get { return _settingLocation; }
            set
            {
                _settingLocation = value;
                OnPropertyChange("ChildAreaName");
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        public virtual void OnPropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }



    }
}
